package com.tong.cloud.example;

import com.tong.cloud.example.config.MapProperties;
import com.tong.cloud.example.config.PropertisConfiguration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RestController
@SpringBootApplication
public class PropertiesApplication {

    public static void main(String[] args) {
        SpringApplication.run(PropertiesApplication.class, args);
    }

    @Autowired
    private PropertisConfiguration propertisConfiguration;

    @GetMapping("/get")
    public Map<String,Long> get() {
        return propertisConfiguration.getMapProperties().getConfigs();
    }

}
